﻿#include<iostream>
#include<map>

void printMap(std::map<int,int>& m)
{
	for (std::map<int, int>::iterator it = m.begin(); it != m.end(); ++it)
	{
		std::cout << "key = " << it->first << "   value = " << (*it).second << '\n';
	}
	std::cout << '\n';
}

void test01()
{
	std::map<int, int> m1;
	
	m1.insert(std::pair<int, int>(1, 10));
	m1.insert(std::pair<int, int>(3, 30));
	m1.insert(std::pair<int, int>(2, 20));
	m1.insert(std::pair<int, int>(5, 50));
	m1.insert(std::pair<int, int>(4, 40));

	printMap(m1);

	std::map<int, int> m2(m1);
	printMap(m2);

	std::map<int, int> m3;
	m3 = m1;
	printMap(m2);
}

int main()
{
	test01();

	return 0;
}
